package com.yunxiang.controller;

import com.jfinal.core.Controller;
import com.tencent.WXPay;
import com.tencent.protocol.sendredpack_protocol.SendRedpackReqData;

public class SendRedpackController extends Controller {

	public void sendRedpack() throws Exception{
		
		String send_name = "盛时";
		String re_openid = "ojWZZwOGTRn5JatWc2YzEp2VeeFE";
		Integer total_amount = 100;
		Integer total_num = 1;
		String wishing = "恭喜发财";
		String client_ip = "115.159.6.217";
		String act_name = "加顾客，抢红包";
		String remark = "顾客越多，红包越多";
		
		SendRedpackReqData sendRedpackReqData = new SendRedpackReqData(send_name, re_openid, total_amount, total_num, wishing, client_ip, act_name, remark);
		
		String requestSendRedpackService = WXPay.requestSendRedpackService(sendRedpackReqData);
		
		System.out.println(requestSendRedpackService);
		
		renderText(requestSendRedpackService);
	}
}
